function check_regist(sub=false){
	var username = document.getElementsByName("username")[0].value;
 	var password = document.getElementsByName("password")[0].value;
	var email = document.getElementsByName("email")[0].value;
	var username_error = document.getElementById("username_error"); 
	var password_error = document.getElementById("password_error"); 
	var email_error = document.getElementById("email_error"); 
	var errorNum =0;
	var reg= /^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w{2,3})+$/;
 	if(username==null || username==""){
		username_error.style.display = "inline";
		errorNum++;
	}else{
		username_error.style.display = "none";
	}
	if(password==null || password==""){
		password_error.style.display = "inline";
		errorNum++;
	}else{
		password_error.style.display = "none";
	}
 	if(email==null || email=="" || !reg.test(email)){
		email_error.style.display = "inline";
		errorNum++;
	}else{
		email_error.style.display = "none";
	}
	if(!sub) return;
	if(errorNum<=0){
		return true;
	}
	return false;
}
